home *** CD-ROM | disk | FTP | other *** search
/ Scene 96 / Scene 96 International Edition (Zyklop Software) (Disc 2) (1997).iso / misc / coding / midas060 / src / errors.inc < prev    next >
Encoding:
Text File  |  1997-01-16  |  6.7 KB  |  221 lines

  1. ;*      errors.inc
  2. ;*
  3. ;* MIDAS Sound System error codes and error message strings
  4. ;*
  5. ;* $Id: errors.inc,v 1.4 1997/01/16 18:41:59 pekangas Exp $
  6. ;*
  7. ;* Copyright 1996,1997 Housemarque Inc.
  8. ;*
  9. ;* This file is part of the MIDAS Sound System, and may only be
  10. ;* used, modified and distributed under the terms of the MIDAS
  11. ;* Sound System license, LICENSE.TXT. By continuing to use,
  12. ;* modify or distribute this file you indicate that you have
  13. ;* read the license and understand and accept it fully.
  14. ;*
  15.  
  16.  
  17. ;/***************************************************************************\
  18. ;*     enum ErrorCodes
  19. ;*     ---------------
  20. ;* Description:  MIDAS Sound System error codes
  21. ;\***************************************************************************/
  22.  
  23. ENUM    ErrorCodes \
  24.     OK = 0, \            ; no error
  25.     errUndefined, \         ; undefined error
  26.     errOutOfMemory, \        ; out of (conventional) memory
  27.     errHeapCorrupted, \        ; (conventional memory) heap corrupted
  28.     errInvalidBlock, \        ; invalid memory block
  29.     errOutOfEMS, \            ; out of EMS memory
  30.     errEMSHeapCorrupted, \        ; EMS heap corrupted
  31.     errInvalidEMSBlock, \        ; invalid EMS memory block
  32.     errEMMFailure, \        ; Expanded Memory Manager failure
  33.     errOutOfCardMemory, \        ; out of soundcard memory
  34.     errCardHeapCorrupted, \     ; soundcard heap corrupted
  35.     errInvalidCardBlock, \        ; invalid soundcard memory block
  36.     errNoInstHandles, \        ; out of instrument handles
  37.     errFileOpen, \            ; unable to open file
  38.     errFileRead, \            ; unable to read file
  39.     errInvalidModule, \        ; invalid module file
  40.     errInvalidInst, \        ; invalid instrument in module
  41.     errInvalidPatt, \        ; invalid pattern data in module
  42.     errInvalidChanNumber, \     ; invalid channel number
  43.     errInvalidSampleHandle, \      ; invalid instrument handle
  44.     errNoChannels, \        ; Sound Device channels not open
  45.     errSDFailure, \         ; Sound Device hardware failure
  46.     errInvalidArguments, \        ; invalid function arguments
  47.     errFileNotFound, \        ; file does not exist
  48.     errInvalidFileHandle, \     ; invalid file handle
  49.     errAccessDenied, \        ; access denied
  50.     errFileExists, \        ; file exists
  51.     errTooManyFiles, \        ; too many open files
  52.     errDiskFull, \            ; disk full
  53.     errEndOfFile, \         ; unexpected end of file
  54.     errInvalidPath, \        ; invalid path
  55.     errFileWrite, \         ; unable to write file
  56.     errVDSLock, \            ; unable to lock VDS DMA buffer
  57.     errVDSUsage, \            ; unable to use Virtual DMA
  58.     errBadVDS, \            ; invalid VDS version
  59.     errDPMIFailure, \        ; DPMI failure
  60.     errInvalidDescriptor, \     ; invalid segment descriptor
  61.     errOutOfResources        ; out of system resources
  62.  
  63.  
  64.  
  65.  
  66. GLOBAL    LANG errorMsg : _ptr        ; error message strings
  67.  
  68.  
  69. ;/***************************************************************************\
  70. ;*     enum FunctionIDs
  71. ;*     ----------------
  72. ;* Description:  ID numbers for first functions in all modules
  73. ;\***************************************************************************/
  74.  
  75. ENUM    FunctionIDs \
  76.     ID_error = 0, \         ; error handling
  77.     ID_dma = 100, \         ; DMA handling routines
  78.     ID_dsm = 200, \         ; Digital Sound Mixer
  79.     ID_ems = 300, \         ; EMS heap manager
  80.     ID_mem = 400, \         ; Conventional memory management
  81.     ID_mod = 500, \         ; Protracker Module Player
  82.     ID_s3m = 600, \         ; Scream Tracker 3 Module Player
  83.     ID_mtm = 700, \         ; Multitracker Module Player
  84.     ID_tmr = 1000, \        ; TempoTimer
  85.     ID_vu = 1100, \         ; Real VU meters
  86.     ID_rf = 1200, \         ; Raw file I/O
  87.     ID_file = 1300, \        ; High-level file I/O
  88.     ID_dpmi = 1400, \        ; DPMI functions
  89.     ID_gmp = 1500, \        ; Generic Module Player
  90.         ID_fx = 1600, \                 ; Sound effects library
  91.         ID_str = 1700, \                ; Stream library
  92.     ID_gus = 2000, \        ; GUS Sound Device
  93.     ID_pas = 2100, \        ; PAS Sound Device
  94.     ID_wss = 2200, \        ; WSS Sound Device
  95.     ID_sb = 2300, \         ; SB Sound Device
  96.         ID_winw = 2400, \               ; Windows Wave Sound Device
  97.         ID_oss = 2500, \                ; OSS Sound Device
  98.         ID_gdc = 2600, \                ; GUS Mixing Sound Device
  99.     ID_nsnd = 2900, \        ; No Sound Sound Device
  100.     ID_mixsd = 3000         ; Mixing Sound Device common functions
  101.  
  102.  
  103.  
  104. IFDEF DEBUG
  105.  
  106. ;/***************************************************************************\
  107. ;*     struct errRecord
  108. ;*     ----------------
  109. ;* Description:  Error record for error list
  110. ;\***************************************************************************/
  111.  
  112. STRUC    errRecord
  113. D_int    errorCode            ; error code number
  114. D_int    functID             ; ID for function that caused the
  115.                     ; error
  116. ENDS
  117.  
  118. MAXERRORS = 256             ; maximum number of errors in list
  119.  
  120. GLOBAL    LANG errorList : errRecord    ; error list
  121. GLOBAL    LANG numErrors : _int        ; number of errors in list
  122.  
  123.  
  124.  
  125. ;/***************************************************************************\
  126. ;*
  127. ;* Function:     void errAdd(int errorCode, unsigned functID);
  128. ;*
  129. ;* Description:  Add an error to error list
  130. ;*
  131. ;* Input:     int errorCode         error code
  132. ;*         unsigned functID     ID for function that caused the error
  133. ;*
  134. ;\***************************************************************************/
  135.  
  136. GLOBAL    LANG errAdd : _funct
  137.  
  138.  
  139.  
  140.  
  141. ;/***************************************************************************\
  142. ;*
  143. ;* Function:    void errClearList(void)
  144. ;*
  145. ;* Description: Clears the error list. Can be called if a error has been
  146. ;*        handled without exiting the program to avoid filling the
  147. ;*        error list with handled errors.
  148. ;*
  149. ;\***************************************************************************/
  150.  
  151. GLOBAL    LANG errClearList : _funct
  152.  
  153.  
  154.  
  155.  
  156. ;/***************************************************************************\
  157. ;*
  158. ;* Function:     void errPrintList(void);
  159. ;*
  160. ;* Description:  Prints the error list to stderr
  161. ;*
  162. ;\***************************************************************************/
  163.  
  164. GLOBAL    LANG errPrintList : _funct
  165.  
  166.  
  167. ENDIF
  168.  
  169.  
  170.  
  171. ;/***************************************************************************\
  172. ;*
  173. ;* Function:     void errErrorExit(char *msg)
  174. ;*
  175. ;* Description:  Set up standard text mode, print an error message and exit
  176. ;*
  177. ;* Input:     char *msg         pointer to error message, ASCIIZ
  178. ;*
  179. ;\***************************************************************************/
  180.  
  181. GLOBAL    LANG errErrorExit : _funct
  182.  
  183.  
  184.  
  185.  
  186. ;/***************************************************************************\
  187. ;*
  188. ;* Macro:    ERROR    functID
  189. ;*
  190. ;* Description: Adds an error to the MIDAS error list if DEBUG is defined.
  191. ;*        Does nothing otherwise.
  192. ;*
  193. ;* Input:    ax        error code
  194. ;*        functID     function ID
  195. ;*
  196. ;* Destroys:    all except ax, ds, si, di
  197. ;*
  198. ;\***************************************************************************/
  199.  
  200. MACRO    ERROR    functID
  201. IFDEF    DEBUG
  202.     push    _ax
  203.     call    errAdd LANG, _ax, functID
  204.     pop    _ax
  205. ENDIF
  206. ENDM
  207.  
  208.  
  209. ;* $Log: errors.inc,v $
  210. ;* Revision 1.4  1997/01/16 18:41:59  pekangas
  211. ;* Changed copyright messages to Housemarque
  212. ;*
  213. ;* Revision 1.3  1996/09/22 23:15:45  pekangas
  214. ;* Updated to correspond to current errors.h
  215. ;*
  216. ;* Revision 1.2  1996/05/30 22:38:46  pekangas
  217. ;* no changes?
  218. ;*
  219. ;* Revision 1.1  1996/05/22 20:49:33  pekangas
  220. ;* Initial revision
  221. ;*